package gat.convertor.dic;

import org.mapstruct.Mapper;

import com.bitsun.core.common.convertor.IConvertor;
import com.bitsun.core.common.persistence.Pager;

import gat.domain.model.dic.DicTypeEntity;
import gat.dto.res.dic.DicTypeResDto;
import gat.infrastructure.persistence.po.dic.DicTypePo;

/**
 * 
 * @author: tmac
 * @email: tmac
 */

@Mapper(componentModel="spring")
public abstract class DicTypeResDtoConvertor implements IConvertor<DicTypeResDto, DicTypeEntity, DicTypePo> {

    public  Pager<DicTypeResDto> convertPoPager2ResDtoPager(Pager<DicTypePo> poPager) {
        if (poPager == null) {
            return null;
        }

        Pager<DicTypeResDto> resDtoPager = new Pager();
        resDtoPager.setTotalCount(poPager.getTotalCount());
        resDtoPager.setPageSize(poPager.getPageSize());
        resDtoPager.setTotalPage(poPager.getTotalPage());
        resDtoPager.setCurrentPage(poPager.getCurrentPage());
        resDtoPager.setList(poList2DtoList(poPager.getList()));

        return resDtoPager;
    }
}








